package com.hmall.config;

import com.hmall.common.dto.Filters;
import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import com.hmall.common.dto.Stock;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Description ItemConfig
 * @Author zhengyuan&junjun
 * @Date 2024-11-14
 */
@FeignClient("itemservice")
@RequestMapping(value = "/item")
public interface ItemConfig {
    @GetMapping("/list")
    PageDTO<Item>list(@RequestParam("page") Integer page,@RequestParam("size") Integer size);
    @PostMapping("/list")
    PageDTO<Item> finds(@RequestBody Filters filters);
    /**
     * 暴露查询商品id接口
     * **/
    @GetMapping(value = "/{id}",headers= "Accept=application/json" ) //headers= "Accept=application/json"headers是一个简单表示接受application/json类型数据的头部信息设置方式
    Item getbyId(@PathVariable("id") Long id);
    /**
     *
     * 暴露更新库存数量接口
     * **/
    @PostMapping("/stock")
     public  void stock(@RequestBody Stock stock);

}
